all: entry.o main.o boot.o
	ld -m elf_i386 -T kernel.lds -o system *.o
	rm -r *.o

entry.o: kernel/entry.c
	gcc -march=i386 -I. -Wall -Wextra -fno-builtin -nostdlib  -nostartfiles -nodefaultlibs -c kernel/entry.c -o entry.o

main.o: kernel/main.cpp
	g++ -march=i386 -I. -Wall -Wextra -fno-builtin -nostdlib  -nostartfiles -nodefaultlibs -c kernel/main.cpp -o main.o

boot.o: boot/boot.S
	gcc -m32 -march=i386 -I. -Wall -Wextra -fno-builtin -nostdlib  -nostartfiles -nodefaultlibs -c boot/boot.S -o boot.o

clean:
	rm -r *.swp *.bin *.o